home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir41 / x10xa200.zip / XA.CMD < prev    next >
OS/2 REXX Batch file  |  1993-10-16  |  10KB  |  260 lines

  1. DISPLAY OFF
  2. #
  3. #  ┌─────────────────────────────────────────────────────────────────┐
  4. #  │                                                                 │
  5. #  │   XA - X10 Command Interpreter for the CP-290 - Version 2.00    │
  6. #  │   Copyright 1991-93 by Bruce Christensen. All Rights Reserved.  │
  7. #  │                                                                 │
  8. #  └─────────────────────────────────────────────────────────────────┘
  9. #
  10. #──────────────────────────────────────────────────────────────────────────────
  11. #
  12. #
  13. #    IF NONE OF THIS MAKES SENSE....
  14. #                                   ....READ THE MANUAL (XA.TXT)
  15. #
  16. #
  17. #──────────────────────────────────────────────────────────────────────────────
  18. #
  19.  
  20. # You can pass arguments to a command file and react accordingly. If you 
  21. # pass a non-zero variable and test it with the IF statement, it will 
  22. # result in a TRUE condition. For example:
  23. #       XA f=xa.cmd "vacation = 1"
  24.  
  25. # The following tokens are not activated for the SHAREWARE version...
  26.  
  27. #IF (vacation)
  28. # DISPLAY ON
  29. # Entrance_Chandelier ON TIME 9:30 PM RANDOM 15 TODAY
  30. # Entrance_Chandelier OFF TIME 10:30 PM RANDOM 15 TODAY
  31. # DISPLAY OFF
  32.  
  33. # ELSE                    # Do all the other things...
  34.  
  35. #
  36. #──────────────────────────────────────────────────────────────────────────────
  37. #
  38. #    Produce a report file listing events for each day. Use REPORT1 to
  39. #    generate a listing events in the order they occur for each day. 
  40. #    Use REPORT2 to list events for each day by module.
  41.  
  42. REPORT1
  43.  
  44. #  
  45. #──────────────────────────────────────────────────────────────────────────────
  46. #
  47. #    The next token (ERASE) will remove all events from the CP-290
  48. #    memory. You are advised to use this when you use the DATE token for
  49. #    programming specific events. This ensures that when the event has
  50. #    passed, it will be deleted. Since every one of your events should
  51. #    be included in this file, there is no need to worry about erasing them
  52. #    now...they will be downloaded automatically.
  53.  
  54. ERASE
  55.  
  56. #
  57. #──────────────────────────────────────────────────────────────────────────────
  58. #
  59. #    Set the X10 clock to the time and date of your PC's internal clock.
  60. #    Use the optional "EXACT" token to wait for the seconds counter to
  61. #    rollover to 0.
  62.  
  63. SYNCHRONIZE X10 EXACT
  64.  
  65. #
  66. #──────────────────────────────────────────────────────────────────────────────
  67. #
  68. #    Set the PC clock to the time of your X10's internal clock.
  69. #    Use the optional "EXACT" token to wait for the seconds counter to
  70. #    rollover to 0.
  71. #
  72. #    Note: There is not enough information from the X10 to set the date.
  73.  
  74. #SYNCHRONIZE PC EXACT
  75.  
  76. #
  77. #──────────────────────────────────────────────────────────────────────────────
  78. #
  79. #    The following are a set of commands that are downloaded weekly. See the
  80. #    documentation for full details - but here's a synopsis:
  81. #    Every Sunday morning at 3:00, the computer is turned on via X10. As
  82. #    DOS executes AUTOEXEC.BAT, a utility supplied with this package,
  83. #    POWERUP.EXE will return an ERRORLEVEL of 1 if the current time is
  84. #    within a range that you specify. This errorlevel can then be used to 
  85. #    invoke XA.EXE to download another weeks worth of events, or you can use
  86. #    it to call other programs as well, for instance: backup programs, 
  87. #    communications, etc. See the documentation for more details.
  88. #    
  89. #    Note the use of the SUNRISE and SUNSET tokens. These tokens will 
  90. #    calculate the exact time of sunrise or sunset for your city assuming 
  91. #    LATITUDE, LONGITUDE, and TIMEZONE were all entered correctly. 
  92. #    This avoids having to constantly enter a new time for your outdoor lights.
  93.  
  94. DISPLAY ON
  95.  
  96. #INCLUDE INC1.CMD
  97.  
  98. #    Sunday's events:
  99.  
  100. DECK_LIGHTS_1           ON      SUNDAY  SUNSET OFFSET 5
  101. DECK_LIGHTS_1           DIM 50  SUNDAY  DUSK
  102. DECK_LIGHTS_1           OFF     SUNDAY  SUNSET OFFSET 1:30
  103. LIVING_ROOM_LAMP        OFF     SUNDAY  TIME 11:30 PM
  104. LIVING_ROOM_LAMP        ON      SUNDAY  DUSK
  105. FAMILY_ROOM_LAMP        ON      SUNDAY  SUNSET OFFSET -1:00
  106. FAMILY_ROOM_LAMP        OFF     SUNDAY  TIME 11:30 PM
  107. BEDROOM_LIGHT           ON      SUNDAY  TIME 10:30 PM RANDOM +15
  108. BEDROOM_LIGHT           OFF     SUNDAY  TIME 1:30 AM
  109. OUTSIDE_PORCH_LIGHTS    DIM 80  SUNDAY  SUNSET
  110. OUTSIDE_PORCH_LIGHTS    OFF     SUNDAY  TIME 10:30 PM RANDOM +15
  111.  
  112.  
  113. #    Monday's events:
  114.  
  115. LIVING_ROOM_LAMP        ON      MONDAY  DUSK
  116. LIVING_ROOM_LAMP        OFF     MONDAY  TIME 11:30 PM
  117. DECK_LIGHTS_1           ON      MONDAY  SUNSET
  118. DECK_LIGHTS_1           DIM 50  MONDAY  DUSK
  119. DECK_LIGHTS_1           OFF     MONDAY  SUNSET OFFSET 1:30
  120. FAMILY_ROOM_LAMP        ON      MONDAY  SUNSET OFFSET -1:00
  121. FAMILY_ROOM_LAMP        OFF     MONDAY  TIME 11:30 PM
  122. BEDROOM_LIGHT           ON      MONDAY  TIME 10:30 PM RANDOM +15
  123. BEDROOM_LIGHT           OFF     MONDAY  TIME 1:30 AM
  124. OUTSIDE_PORCH_LIGHTS    DIM 80  MONDAY  SUNSET
  125. OUTSIDE_PORCH_LIGHTS    OFF     MONDAY  TIME 10:30 PM RANDOM +15
  126.  
  127. #    Tuesday's events:
  128.  
  129. LIVING_ROOM_LAMP        ON      TUESDAY DUSK
  130. LIVING_ROOM_LAMP        OFF     TUESDAY TIME 11:30 PM
  131. DECK_LIGHTS_1           ON      TUESDAY SUNSET OFFSET 5
  132. DECK_LIGHTS_1           DIM 50  TUESDAY DUSK
  133. DECK_LIGHTS_1           OFF     TUESDAY SUNSET OFFSET 1:30
  134. FAMILY_ROOM_LAMP        ON      TUESDAY SUNSET OFFSET -1:00
  135. FAMILY_ROOM_LAMP        OFF     TUESDAY TIME 11:30 PM
  136. BEDROOM_LIGHT           ON      TUESDAY TIME 10:30 PM RANDOM +15
  137. BEDROOM_LIGHT           OFF     TUESDAY TIME  1:30 AM
  138. OUTSIDE_PORCH_LIGHTS    DIM 80  TUESDAY SUNSET
  139. OUTSIDE_PORCH_LIGHTS    OFF     TUESDAY TIME 10:30 PM RANDOM +15
  140.  
  141. #    Wednesday's events:
  142.  
  143. LIVING_ROOM_LAMP        ON      WED   DUSK
  144. LIVING_ROOM_LAMP        OFF     WED   TIME 11:30 PM
  145. DECK_LIGHTS_1           ON      WED   SUNSET OFFSET 5
  146. DECK_LIGHTS_1           DIM 50  WED   DUSK
  147. DECK_LIGHTS_1           OFF     WED   SUNSET OFFSET 1:30
  148. FAMILY_ROOM_LAMP        ON      WED   SUNSET OFFSET -1:00
  149. FAMILY_ROOM_LAMP        OFF     WED   TIME 11:30 PM
  150. BEDROOM_LIGHT           ON      WED   TIME 10:30 PM RANDOM +15
  151. BEDROOM_LIGHT           OFF     WED   TIME  1:30 AM
  152. OUTSIDE_PORCH_LIGHTS    DIM 80  WED   SUNSET
  153. OUTSIDE_PORCH_LIGHTS    OFF     WED   TIME 10:30 PM RANDOM +15
  154.  
  155. #    Thursday's events:
  156.  
  157. LIVING_ROOM_LAMP        ON      THU   DUSK
  158. LIVING_ROOM_LAMP        OFF     THU   TIME 11:30 PM
  159. DECK_LIGHTS_1           ON      THU   SUNSET OFFSET 5
  160. DECK_LIGHTS_1           DIM 50  THU   DUSK
  161. DECK_LIGHTS_1           OFF     THU   SUNSET OFFSET 1:30
  162. FAMILY_ROOM_LAMP        ON      THU   SUNSET OFFSET -1:00
  163. FAMILY_ROOM_LAMP        OFF     THU   TIME 11:30 PM
  164. BEDROOM_LIGHT           ON      THU   TIME 10:30 PM RANDOM +15
  165. BEDROOM_LIGHT           OFF     THU   TIME  1:30 AM
  166. OUTSIDE_PORCH_LIGHTS    DIM 80  THU   SUNSET
  167. OUTSIDE_PORCH_LIGHTS    OFF     THU   TIME 10:30 PM RANDOM +15
  168.  
  169. #    Friday's events:
  170.  
  171. LIVING_ROOM_LAMP        ON      FRIDAY  DUSK
  172. LIVING_ROOM_LAMP        OFF     SATURDAY TIME 12:30 PM
  173. DECK_LIGHTS_1           ON      FRIDAY  SUNSET OFFSET 5
  174. DECK_LIGHTS_1           DIM 50  FRIDAY  DUSK
  175. DECK_LIGHTS_1           OFF     FRIDAY  SUNSET OFFSET 1:30
  176. FAMILY_ROOM_LAMP        ON      FRIDAY   SUNSET OFFSET -1:00
  177. FAMILY_ROOM_LAMP        OFF     SATURDAY TIME 12:30 PM
  178. BEDROOM_LIGHT           ON      FRIDAY TIME 10:30 PM RANDOM +15 
  179. BEDROOM_LIGHT           OFF     FRIDAY TIME  1:30 AM 
  180. OUTSIDE_PORCH_LIGHTS    DIM 80  FRIDAY  SUNSET
  181. OUTSIDE_PORCH_LIGHTS    OFF     FRIDAY TIME 10:30 PM RANDOM +15
  182.  
  183. #    Saturday's events:
  184.  
  185. OUTSIDE_PORCH_LIGHTS    DIM 80  SATURDAY SUNSET
  186. LIVING_ROOM_LAMP        ON      SATURDAY DUSK
  187. LIVING_ROOM_LAMP        OFF     SUNDAY   TIME 12:30 AM 
  188. DECK_LIGHTS_1           ON      SATURDAY SUNSET OFFSET 5
  189. DECK_LIGHTS_1           DIM 50  SATURDAY DUSK
  190. DECK_LIGHTS_1           OFF     SATURDAY SUNSET OFFSET 1:30
  191. FAMILY_ROOM_LAMP        ON      SATURDAY SUNSET OFFSET -1:00
  192. FAMILY_ROOM_LAMP        OFF     SUNDAY   TIME 12:30 AM 
  193. BEDROOM_LIGHT           ON      SATURDAY TIME 10:30 PM RANDOM +15 
  194. BEDROOM_LIGHT           OFF     SATURDAY TIME  1:30 AM 
  195. OUTSIDE_PORCH_LIGHTS    OFF     SATURDAY TIME 10:30 PM RANDOM +15
  196.  
  197. #    Other events:
  198.  
  199. DEHUMIDIFIER            ON      EVERYDAY ON  TIME 5:00 AM
  200. DEHUMIDIFIER            OFF     EVERYDAY OFF TIME 9:00 AM
  201. DEHUMIDIFIER            ON      EVERYDAY ON  TIME 5:00 PM
  202. DEHUMIDIFIER            OFF     EVERYDAY OFF TIME 9:00 PM
  203. HALLWAY                 OFF     EVERYDAY DAWN
  204. STAIRS                  DIM 40  EVERYDAY DUSK
  205. STAIRS                  DIM 25  EVERYDAY TIME 11:00 PM
  206. STAIRS                  OFF     EVERYDAY DAWN       
  207.  
  208. HALLWAY DIM 25 SCHOOL_NIGHTS TIME 8:25 PM 
  209. HALLWAY DIM 25 FRI SAT TIME 9:45 PM
  210.  
  211.  
  212. #
  213. #──────────────────────────────────────────────────────────────────────────────
  214. #
  215. #    The following event occurs every Sunday at 3:00 AM.
  216. #    When used in conjuction with POWERUP.EXE (in AUTOEXEC.BAT)
  217. #    we can automatically download new commands an a weekly basis.
  218. #    For example, sunrise and sunset change from day to day. The X10
  219. #    computer interface can store these times for 1 week, then it
  220. #    needs to be updated with new times.
  221. #
  222. #    Additional note: Backups are now performed during this time, as
  223. #         well as having all the drives optimized. See the sample 
  224. #         AUTOEXEC.BAT file supplied with this package.
  225. #
  226. #
  227. #    Note: The sample AUTOEXEC.BAT contains the command: XA "PC OFF"
  228. #    after the download, optimizations, and backups have been performed.
  229. #    But just in case something went wrong (like leaving a floppy in Drive A),
  230. #    we'll have the CP-290 turn the computer off 2 hours later.
  231.  
  232.  
  233. COMPUTER ON  SUNDAY TIME 3:00
  234. COMPUTER OFF SUNDAY TIME 5:00
  235.  
  236. #
  237. # Turn ON various lights on weekday mornings only when sunrise occurs
  238. # at least 1 hour after they're needed.
  239. #
  240.  
  241. # The following tokens are not activated for the SHAREWARE version...
  242.  
  243. # IF (SUNRISE > TIME 6:00)
  244. #   OUTSIDE_PORCH_LIGHTS    DIM 80  WEEKDAYS  TIME 5:30 RANDOM 10
  245. #   OUTSIDE_PORCH_LIGHTS    OFF     WEEKDAYS  SUNRISE
  246. #
  247. #   LIVING_ROOM_LAMP        ON      WEEKDAYS  TIME 5:35 RANDOM 10
  248. #   LIVING_ROOM_LAMP        OFF     WEEKDAYS  SUNRISE OFFSET 10
  249. # ENDIF
  250.  
  251.  
  252. # ENDIF     # from IF (vacation)
  253.  
  254.  
  255.  
  256.  
  257. #                     That's all folks.
  258.  
  259.